www.mxdraw.com
内容索引主面
前一个向上下一个
IMxDrawCurve::GetArea 方法

返回曲线组成的闭合区域面积

IDL
[helpstring("method GetArea")]
HRESULT GetArea([out] DOUBLE* pArea, [out,retval] VARIANT_BOOL* isOk);
参数 
说明 
[out] DOUBLE* pArea 
返回闭合区域面积 

成功返回TRUE

例如: C#代码,计算面积

        MxDrawPolyline pl = new MxDrawPolyline();

        MxDrawPoint pt1 = new MxDrawPoint();
        pt1.x = 10;
        pt1.y = 10;
        MxDrawPoint pt2 = new MxDrawPoint();

        pt2.x = 20;
        pt2.y = 20;
        MxDrawPoint pt3 = new MxDrawPoint();

        pt3.x = 30.5;
        pt3.y = 10;
        pl.AddVertexAt(pt1);
        pl.AddVertexAt(pt2);
        pl.AddVertexAt(pt3);
        pl.IsClosedStatus = true;

        double dArea = 0.0;
        pl.GetArea(out dArea);
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!